import Vue from 'vue';
import App from './App';
import router from './router-config';
import { createStore } from './store';
import VueLocalStorage from 'vue-ls';
import config from './common/config';
import 'mint-ui/lib/style.css';
import './assets/mui.css';
import './assets/animate.css';
import './assets/form-style.css';
import compTextarea from './components/comp-textarea';
import Navigation from 'vue-navigation';
import common from './common/common';
import { Actionsheet } from 'mint-ui';
import {
  Swipe,
  SwipeItem,
  Button,
  Header,
  Tabbar,
  TabItem,
  Popup,
  Field,
  Loadmore,
  Spinner,
  Cell,
  Checklist,
  Radio,
  Picker
} from 'mint-ui';
import VueCookies from 'vue-cookies';

Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);
Vue.component(Header.name, Header);
Vue.component(Tabbar.name, Tabbar);
Vue.component(TabItem.name, TabItem);
Vue.component(Popup.name, Popup);
Vue.component(Field.name, Field);
Vue.component(Loadmore.name, Loadmore);
Vue.component(Spinner.name, Spinner);
Vue.component(Cell.name, Cell);
Vue.component(Checklist.name, Checklist);
Vue.component(compTextarea.name, compTextarea);
Vue.component(Radio.name, Radio);
Vue.component(Picker.name, Picker);
Vue.component(Actionsheet.name, Actionsheet);

const store = createStore();
Vue.config.productionTip = false;
Vue.use(VueLocalStorage, { namespace: config.storageNamespace });
Vue.use(VueCookies);
Vue.use(Navigation, {router, store});

const vueConstruct = new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
});

common.initAPI();
router.vueConstruct = vueConstruct;
